const { defineConfig } = require("@vue/cli-service");
// const TerserPlugin = require("terser-webpack-plugin");
// const Timestamp = new Date().getTime();
// 引入 ParallelUglifyPlugin 插件
// const ParallelUglifyPlugin = require('webpack-parallel-uglify-plugin');
// const CompressionPlugin = require('compression-webpack-plugin');
require("events").EventEmitter.defaultMaxListeners = 0;
// 头部引入
// const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
let target = "http://192.168.1.194:8080"; //王锦
// let target = "http://192.168.1.192:8080" //孙创创
// let target = "http://192.168.1.206:8080" //张林峰
// let target = "http://hunan.xinwo365.com/" //湖南测试站
// let target = "https://www.hngbjy.com/" //湖南正式站

module.exports = defineConfig({
  configureWebpack: {
    performance: {
      hints: "warning",
      //入口起点的最大体积
      maxEntrypointSize: 50000000,
      //生成文件的最大体积
      maxAssetSize: 30000000,
      //只给出 js 文件的性能提示
      assetFilter: function (assetFilename) {
        return assetFilename.endsWith(".js");
      },
    },
  },
  // transpileDependencies: true,
  transpileDependencies: [/node_modules/],

  lintOnSave: false,
  publicPath: "./",
  productionSourceMap: false,
  // 跨域代理
  devServer: {
    proxy: {
      "/": {
        target,
        changeOrigin: true,
        ws: false,
        pathRewrite: {},
      },
    },
  },
});
